﻿<%@ Page Language="C#" Theme="PAT_Theme" MasterPageFile="~/master/PAT.master" AutoEventWireup="true"  CodeFile="PatHistoricEntityEdit.aspx.cs" Inherits="PatHistoricEntityEdit" Title="PatHistoricEntity Edit" %>

<asp:Content ID="Content2" ContentPlaceHolderID="subHeaderContent" Runat="Server">Pat Historic Entity - Agregar/Editar</asp:Content>
<asp:Content ID="Content1" ContentPlaceHolderID="mainContent" Runat="Server">
		<data:MultiFormView ID="FormView1" DataKeyNames="EntityName" runat="server" DataSourceID="PatHistoricEntityDataSource">
		
			<EditItemTemplatePaths>
				<data:TemplatePath Path="usercontrols/PatHistoricEntityFields.ascx" />
			</EditItemTemplatePaths>
		
			<InsertItemTemplatePaths>
				<data:TemplatePath Path="usercontrols/PatHistoricEntityFields.ascx" />
			</InsertItemTemplatePaths>
		
			<EmptyDataTemplate>
				<b>PatHistoricEntity not found!</b>
			</EmptyDataTemplate>
			
			<FooterTemplate>
				<asp:Button ID="InsertButton" runat="server" CausesValidation="True" CommandName="Insert" Text="Crear" />
				<asp:Button ID="UpdateButton" runat="server" CausesValidation="True" CommandName="Update" Text="Actualizar" />
				<asp:Button ID="CancelButton" runat="server" CausesValidation="False" CommandName="Cancel" Text="Cancelar" />
			</FooterTemplate>

		</data:MultiFormView>
		
		<data:PatHistoricEntityDataSource ID="PatHistoricEntityDataSource" runat="server"
			SelectMethod="GetByEntityName"
		>
			<Parameters>
				<asp:QueryStringParameter Name="EntityName" QueryStringField="EntityName" Type="String" />

			</Parameters>
		</data:PatHistoricEntityDataSource>
		
		<br />

		<data:EntityGridView ID="GridViewPatHistoricAttributeByEntity1" runat="server"
			AutoGenerateColumns="False"	
			OnSelectedIndexChanged="GridViewPatHistoricAttributeByEntity1_SelectedIndexChanged"			 			 
			DataSourceID="PatHistoricAttributeByEntityDataSource1"
			DataKeyNames="EntityName, AttibuteName"
			AllowMultiColumnSorting="false"
			DefaultSortColumnName="" 
			DefaultSortDirection="Ascending"	
			ExcelExportFileName="Export_PatHistoricAttributeByEntity.xls"  		
			Visible='<%# (FormView1.DefaultMode == FormViewMode.Insert) ? false : true %>'	
			>
			<Columns>
				<asp:CommandField ShowSelectButton="True" />
				<data:HyperLinkField HeaderText="Entity Name" DataNavigateUrlFormatString="PatHistoricEntityEdit.aspx?EntityName={0}" DataNavigateUrlFields="EntityName" DataContainer="EntityNameSource" DataTextField="EntityDescription" />
				<asp:BoundField DataField="AttributeLabel" HeaderText="Attribute Label" SortExpression="[ATTRIBUTE_LABEL]" />				
				<asp:BoundField DataField="AttributeOrder" HeaderText="Attribute Order" SortExpression="[ATTRIBUTE_ORDER]" />				
				<asp:BoundField DataField="Active" HeaderText="Active" SortExpression="[ACTIVE]" />				
				<asp:BoundField DataField="CreationLogin" HeaderText="Creation Login" SortExpression="[CREATION_LOGIN]" />				
				<asp:BoundField DataField="CreationDate" HeaderText="Creation Date" SortExpression="[CREATION_DATE]" />				
				<asp:BoundField DataField="ModificationLogin" HeaderText="Modification Login" SortExpression="[MODIFICATION_LOGIN]" />				
				<asp:BoundField DataField="ModificationDate" HeaderText="Modification Date" SortExpression="[MODIFICATION_DATE]" />				
			</Columns>
			<EmptyDataTemplate>
				<b>No Pat Historic Attribute By Entity Found! </b>
				<asp:HyperLink runat="server" ID="hypPatHistoricAttributeByEntity" NavigateUrl="~/admin/PatHistoricAttributeByEntityEdit.aspx">Agregar Nuevo </asp:HyperLink>
			</EmptyDataTemplate>
		</data:EntityGridView>					
		
		<data:PatHistoricAttributeByEntityDataSource ID="PatHistoricAttributeByEntityDataSource1" runat="server" SelectMethod="Find"
			EnableDeepLoad="True"
			>
			<DeepLoadProperties Method="IncludeChildren" Recursive="False">
	            <Types>
					<data:PatHistoricAttributeByEntityProperty Name="PatHistoricEntity"/> 
					<%--<data:PatHistoricAttributeByEntityProperty Name="PatHistoricCollection" />--%>
				</Types>
			</DeepLoadProperties>
			
		    <Parameters>
				<data:SqlParameter Name="Parameters">
					<Filters>
						<data:PatHistoricAttributeByEntityFilter  Column="EntityName" QueryStringField="EntityName" /> 
					</Filters>
				</data:SqlParameter>
				<data:CustomParameter Name="OrderByClause" Value="" ConvertEmptyStringToNull="false" /> 
		    </Parameters>
		</data:PatHistoricAttributeByEntityDataSource>		
		
		<br />
		

</asp:Content>

